package com.blockmeta.bbs.immodule.net.pojo;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * @author AirThor
 * @date 2019/3/28.
 */
public class IMServer implements Parcelable {



    /**
     * ip :
     * port :
     * outIp :
     * online :
     * name :
     */

    @SerializedName("id")
    public int id;
    @SerializedName("ip")
    public String ip;
    @SerializedName("port")
    public String port;
    @SerializedName("out_ip")
    public String outIp;
    @SerializedName("online")
    public boolean online;
    @SerializedName("name")
    public String name;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getOutIp() {
        return outIp;
    }

    public void setOutIp(String outIp) {
        this.outIp = outIp;
    }

    public boolean isOnline() {
        return online;
    }

    public void setOnline(boolean online) {
        this.online = online;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.ip);
        dest.writeString(this.port);
        dest.writeString(this.outIp);
        dest.writeByte(this.online ? (byte) 1 : (byte) 0);
        dest.writeString(this.name);
    }

    public IMServer() {
    }

    protected IMServer(Parcel in) {
        this.id = in.readInt();
        this.ip = in.readString();
        this.port = in.readString();
        this.outIp = in.readString();
        this.online = in.readByte() != 0;
        this.name = in.readString();
    }

    public static final Creator<IMServer> CREATOR = new Creator<IMServer>() {
        @Override
        public IMServer createFromParcel(Parcel source) {
            return new IMServer(source);
        }

        @Override
        public IMServer[] newArray(int size) {
            return new IMServer[size];
        }
    };
}
